home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************
- Date Who Comment
- ---------------------------------------------------------------------
- 03-03-93 ds 2.0-Redesign
-
- 06-03-93 ds - Preview-Funktionen für ADLOAD, FM-MAIN
- - FORCE_720-Flag für PrepWrite (für ADSAVE, PSHOW)
- - CallBack-Hook für PlayEDAN
- - GUI-Programme kommen in CLI-Kommandos.
- - SnapShot()
-
- 12-03-93 ds - Query-Redesign: GetDisplayInfo(), SetDisplayInfo()
-
- 27-04-93 ds - PrepSavEDAN() - Flags (EDAN_RAM_BUFFER)
-
- *************************************************************************/
-
-
-
- /************************************************************************
-
- Display-Related functions:
-
- *************************************************************************/
-
- -----------------------------------------------------------------------------
-
- WORD DisplaySize(UWORD size_mode);
- set size of display:
- size_mode:
- PDP_720
- PDP_360
- PDP_270
- PDP_180
- PDP_120
- PDP_90
-
- width: actual width in pixels
- height: actual height in lines
-
- -----------------------------------------------------------------------------
-
- WORD DisplayPos(WORD *x, WORD *y);
- set Display-position (relative to WB-Screen) for current DisplaySize.
- X/Y: Pointers (!) to the position.
-
- Note:
- It is not possible to position the display everywhere you want.
- As of the current hardware-implementation, you could position the window
- vertically an very scanline, but horizontally only on every 4th
- position. Unfortunately, Position 0 does not correspond with the
- hardware-intern position 0 (which is right after the
- Vertical-Blanking-Interrupt). So depending on the Users position
- of the WB-Screen, it may or it may not be possible to position the
- Display on 0/0. The software will move the display to the next
- possible position on the right. Worst case your position is 3 Pixels
- right from where you expected it.
- The position is returned, which is why you have to pass pointers.
-
-
-
- Note: changing the position for DisplaSize 720 is impossible
-
- Returns: STATUS
-
- -----------------------------------------------------------------------------
-
- WORD DisplayMode( UWORD mode, UWORD keymode);
- set display-mode
- flags:
- PDP_OFF Prisma OFF
- PDP_AMIGA Amiga only
- PDP_PRISMA Prisma only
- PDP_PRISMA_KEY Prisma ON, Amiga ON, keying according to keymode
-
- keymode:
- number of keymode
-
- Note: Before setting the mode, this functions checks wether this mode
- is allowed with the current Prefrences. E.g. PDP_OFF on
- Mono-Monitor-Systems is not allowed. For safety reasons, it is NOT
- possible to override.
-
- Returns: STATUS
-
- WORD QuerySize(WORD size, UWORD *width, UWORD *height)
- Returns the width/height of a given DisplaySize
-
- size: Size you are interested in (e.g. PDP_720) or -1 for current size;
- width: Pointer to UWORD where requested width is returned (or NULL)
- height: Pointer to UWORD where requested width is returned (or NULL)
-
- Note: The Height is measured in LACE, that means if you want to
- open a window on a non-lace screen to cover the Display,
- you have to divide it by two!
-
-
- WORD GetDisplayInfo(struct FMDisplayInfo *info)
- Copys the current Display-Settings in your structure
-
- info: Pointer to your DisplayInfo-buffer
-
- WORD SetDisplayInfo(struct FMDisplayInfo *info)
- Sets the display to the parameters given in your DisplayInfo-Structure.
- Useful for setting all parameters (size, mode, keymode, xpos, ypos) all
- at once.
-
- info: Pointer to your DisplayInfo
-
-
-
-
-
-
- /************************************************************************
-
- RGB->YUV related functions (Showing RGB-Images on Prism-Display)
-
- *************************************************************************/
-
- -----------------------------------------------------------------------------
-
- WORD PrepWrite( UWORD width, height, UWORD flags,
- UBYTE *rlut, UBYTE *glut, UBYTE *blut)
-
- Prepares a line-by-line transfer of Image-Data to display.
- DisplaySize will be adjusted to the Image.
- width/height:
- size of image to be transfered
- flags:
- WRITE_COLOR: the image is an RGB24-Colored image. Must
- be transfered via WriteRGB24Line()-calls
-
- WRITE_BW: the image is 8-Bit-Grey-Scale - Image Must
- be transfered via WriteBW8Line()-calls
-
- WRITE_NO_422: Do not use 422-Mode.
-
- WRITE_FORCE_720:
- DisplaySize will always be 720x585, regardless
- of Image-Size. Smaler images will appear centered
- on the display.
-
-
- rlut, glut, blut:
- Pointer to Look-Up-Table for Red/Green/Blue
- the look-up-tables are organized as
- UBYTE rlut[256]
- UBYTE glut[256]
- UBYTE blut[256]
- If you don't want to use LUTs, pass NULL-Pointers
- For BW-Images, the look-up-table is passed in the
- rlut-pointer
-
- Note: It is *NOT* safe to call any other prisma-function except
- WriteRGB24Line(), WriteBW8Line() until an
- EndWrite()-Call indicates end of transfer.
- Each PrepWrite() must be followed by an EndWrite()
-
- -----------------------------------------------------------------------------
-
- WORD WriteRGB24Line(UBYTE *r, UBYTE *g, UBYTE *b)
- Transfers one line of RGB-Data to the display. The line will appear
- immediatley on the display.
-
- r/g/b Pointer to array containing Red, Green, Blue, organized as
- UBYTE red_array[width]
- UBYTE green_array[width]
- UBYTE blue_array[width]
-
- Note: before calling this function, you must do a PrepWrite() with
- the correct size. This functions does not check wether the given
- buffers are valid, so be careful.
-
- Returns: STATUS
-
- -----------------------------------------------------------------------------
-
- WORD WriteBW8Line(UBYTE *bw_line)
- Transfers one line of RGB-Data to the display. The line will appear
- immediatley on the display.
-
- bw_line Pointer to array containing BW-8-Bit data organized as
- UBYTE bw_line[width]
-
- Note: before calling this function, you must do a PrepWrite() with
- the correct size. This functions does not check wether the given
- buffers are valid, so be careful.
-
- Returns: STATUS
-
- -----------------------------------------------------------------------------
-
- WORD EndWrite()
- Indicates that you have finished to transfer the image to the display
- If this occures before the with PrepWrite() given numbers of lines
- were written to the display, the rest will be filled with black lines.
-
- -----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-
- /************************************************************************
-
- YUV->RGB related functions (Getting RGB-Images from Display)
-
- *************************************************************************/
-
- -----------------------------------------------------------------------------
-
- WORD PrepRead( UWORD width, height, UWORD flags)
-
- Prepares a line-by-line transfer of YUV-RAM to your buffer.
- width/height:
- size of image to be transfered
- The image you get is always the center.
-
- flags:
- READ_COLOR: the image is an RGB24-Colored image. Must
- be transfered via ReadRGB24Line()-calls
-
- READ_BW: the image is 8-Bit-Grey-Scale - Image Must
- be transfered via ReadBW8Line()-calls
-
- READ_FIRST:
- READ_SECOND:
- When DisplaySize is < PDP_720, you can determine
- which half-frame you'd like to read: the first one
- or the second one. Default is READ_FIRST.
-
- Note: When Prism24 is attached, the Display will switch to
- PDP_AMIGA-Mode until EndRead().
-
- Note: When DisplaySize is PDP_720 and you specify a width < 360,
- every second pixel from Display will be skipped.
-
- Note: It is *NOT* safe to call any other prisma-function except
- ReadRGB24Line(), ReadBW8Line() until an
- EndWrite()-Call indicates end of transfer.
- Each PrepRead() must be followed by an EndRead()
-
- -----------------------------------------------------------------------------
-
- WORD ReadRGB24Line(UBYTE *r, UBYTE *g, UBYTE *b)
- Transfers one line of RGB-Data to the buffer
-
- r/g/b Pointer to array containing Red, Green, Blue, organized as
- UBYTE red_array[width]
- UBYTE green_array[width]
- UBYTE blue_array[width]
-
- Note: before calling this function, you must do a PrepRead() with
- the correct size. This functions does not check wether the given
- buffers are valid, so be careful.
-
- Returns: STATUS
-
- -----------------------------------------------------------------------------
-
- WORD ReadBW8Line(UBYTE *bw_line)
- Transfers one line of RGB-Data to the buffer. The buffer ***MUST***
- be large enough to fit one line, elsehwile you'll get heavy explosions!!!
-
- bw_line Pointer to array containing BW-8-Bit data organized as
- UBYTE bw_line[width]
-
- Note: before calling this function, you must do a PrepRead() with
- the correct size. This functions does not check wether the given
- buffers are valid, so be careful.
-
- Returns: STATUS
-
- -----------------------------------------------------------------------------
-
- WORD EndRead()
- Indicates that you have finished to transfer the image to the buffer
-
- -----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
- /************************************************************************
-
- Loading files / EDAN-File-Handling
-
- *************************************************************************/
-
- -----------------------------------------------------------------------------
-
- WORD LoadFile(UBYTE *fname, UWORD flags)
- Displays the given file on the Prisma-Display. Supported formats:
- ILBM, RGB8, YUVN, EDAN
-
- fname: Pointer to filename
-
- flags: see PrepWrite()
-
- Note: when file-format is EDAN, only the first frame will be displayed
-
- -----------------------------------------------------------------------------
-
- WORD PlayEDAN(UBYTE *fname, LONG (*frame_hook)())
- Plays an EDAN-Animation
- fname:
- filename
-
- frame_hook:
- To controll flow and speed of Animation, pass a pointer to
- a function. This function can controll speed by delaying and
- flow be specifing next frame.
-
- The function gets parameters in registers:
- D0: UWORD current_frame (0 for first frame)
- D1: UWORD num_of_frames
-
- Returns in D0 a long-word containing the number
- of the next frame to be displayed. 0 for first frame, num_of_frames-1
- for last frame. If the number is negative (<0) or >=num_if:frames,
- playing will be stopped. The function is called the first time before
- the first frame
-
- If you pass a NULL-Pointer, the Animation will be played one time
- full speed.
-
-
-
-
- -----------------------------------------------------------------------------
-
- WORD PrepLoadEDAN(UBYTE *fname, UWORD flags)
- Prepares an EDAN-File for frame-by-frame display.
- The file is opend and the display set accordingly, but NO frame
- is shown. Do view the first frame, use FirstFrame()
-
- fname:
- Filename of EDAN-File
-
- flags:
- EDAN_RAM_BUFFER *** NOT YET IMPLEMENTED ***
- Load ALL Frames AT ONCE into memory.
-
- EDAN_ORIGINAL_POS
- Position Display at Original Position
-
-
-
- -----------------------------------------------------------------------------
-
- WORD QueryEDAN(struct EDANInfo *info)
- fills out the given buffer with some informations of File loaded/saved.
- Must be called after PrepLoadEDAN() / PrepSaveEDAN() and before
- EndLoadEDAN()/EndSaveEDAN()
-
- -----------------------------------------------------------------------------
-
- WORD NextFrame()
- Displays the next frame of an EDAN-Sequence.
-
- returns:
- -----------------------------------------------------------------------------
-
- WORD PreviousFrame()
- Displays the next frame of an EDAN-Sequence.
-
- returns:
-
- -----------------------------------------------------------------------------
-
- WORD FirstFrame()
- Displays the first frame of an EDAN-Sequence.
-
- -----------------------------------------------------------------------------
-
- WORD LastFrame()
- Displays the last frame of an EDAN-Sequence.
-
- -----------------------------------------------------------------------------
-
- WORD GotoFrame(UWORD n)
- Displays the n-th frame of an EDAN-Sequence. 0 is the first on
-
- -----------------------------------------------------------------------------
-
- WORD EndLoadEDAN()
- Closes the file after loading
-
- -----------------------------------------------------------------------------
-
- WORD PrepSaveEDAN(UBYTE *fname, WORD nf, UWORD flags)
- Prepares the frame-by-frame-saving of EDAN-sequences.
-
- fname: Name of File
-
- nf: Number of Frames. -1 if you don't know how many frames you're going
- to save.
-
- flags:
- EDAN_BW:
- Record Black&White
-
- EDAN_COLOR:
- Record full color resolution
-
- EDAN_LACE:
- When size==PDP_720, you can record lace if you wish.
- size<PDP_720 is always NON-LACE
-
- EDAN_RAM_BUFFER: (NOT YET IMPLEMENTED)
- The frames will be bufferd in RAM until EndSaveEDAN is called.
- Then they are written to the file. You MUST specifiy the number of
- frames as the buffers are right away allocated. Function will fail
- if not enough RAM is available.
-
- EDAN_NO_SYNC: (NOT YET IMPLEMENTED)
- Disables Frame-Sync while recording. Useful for saving
- a frame which was e.g. SnapShot()ed or loaded.
-
- Note: This size of EDAN will be current DisplaySize. Don't forget
- to activate the Digitizer before recording. DONT'T CHANGE DISPLAYSIZE
- WHILE RECORDING!
-
-
- -----------------------------------------------------------------------------
-
- WORD RecordFrame(VOID)
- Saves the currently displayed frame to the file.
- Don't forget to call EndSaveEDAN() when you're done.
-
- -----------------------------------------------------------------------------
-
- WORD EndSaveEDAN()
-
- -----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
- /************************************************************************
-
- Preview-Related-Functions:
-
- *************************************************************************/
-
- WORD FastPreview(UWORD mode)
- Opens a new screen and shows preview on it, until user
- interrupts by pressing mousbutton or key. After breaking, the
- next frame will be stored in full resolution (720x585) in YUV-RAM.
-
- Mode: Display: Screen:
- MD_QUATER 160x128 320x256
- MD_LORES 320x256 320x256
- MD_HIRES 640x256 640x256
-
- WORD FastPreviewBmap(struct BitMap *bmap, struct Window *win, UWORD mode)
- Show Fast Preview on given screen
- bmap: Pointer to bmap. Bmap must be large enough to fit
- the Display.
-
- win: Pointer to window with an IDCMP-Port attached. Preview continues
- until an IDCMP-Message on the IDCMP-Port is recieved. There it
- is important that you have a least one IDCMP_MOUSEBUTTONS,
- IDCMP_MENUPICK or IDCMP_VANILLAKEY set.
-
- Mode: Display: Screen:
- MD_QUATER 160x128 320x256
- MD_LORES 320x256 320x256
- MD_HIRES 640x256 640x256
-
- Note: This function renders directly into the bitmap.
-
-
- /************************************************************************
-
- Prefrences-Functions:
-
- *************************************************************************/
-
- -----------------------------------------------------------------------------
-
- WORD GetFMPrefs(struct FMPref *pref, UWORD size)
- returns the current settings
-
-
- -----------------------------------------------------------------------------
-
- WORD GetSavedPrefs(struct FMPref *pref, UWORD size)
- returns the settings saved in NVRAM
-
- -----------------------------------------------------------------------------
-
- WORD GetDefaultPrefs(struct FMPref *pref, UWORD size)
- returns default settings
-
- -----------------------------------------------------------------------------
-
- WORD UsePrefs(struct FMPref *pref, UWORD size)
- makes the given settings active
-
- -----------------------------------------------------------------------------
-
- WORD SavePrefs(struct FMPref *pref, UWORD size)
- stores the given settings in NVRAM
-
- -----------------------------------------------------------------------------
-
- WORD GetInfo(struct FMInfo *info, UWORD size)
- struct FMInfo
- {
- UWORD fm_ver; /* FrameMachine-BaseBoard-version */
- UWORD fm_rev; /* FrameMachine-BaseBoard-revision */
-
- UWORD pm_ver; /* Prism-Board-version */
- UWORD pm_rev; /* Prism-Board-revision */
-
- UWORD xil_ver; /* Xilinx-File-version */
- UWORD xil_rev; /* Xilinx-File-revision */
-
- UWORD lib_ver; /* Library-Version */
- UWORD liv_rev; /* Library-Revision */
-
- }
-
- -----------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /************************************************************************
-
- MISC-Functions:
-
- *************************************************************************/
-
- -----------------------------------------------------------------------------
-
- UBYTE *ExplainStatus(WORD status)
- Return pointer to a zero-terminated string explaining the given
- error-condition.
-
- status:
- Error-Code returned by any prisma.library-funtion
-
- -----------------------------------------------------------------------------
- VOID DisplayStatus(WORD status)
- Pops up a little AutoRequest() explaining the error-condition to the
- User.
-
- status:
- Error-Condition from framemachine.library
-
- -----------------------------------------------------------------------------
-
- VOID LockFM()
- Gives you exclusive access to framemacine. If the machine
- is currently locked by someone else, this function will wait for it to be
- released. Nesting allowed.
-
- -----------------------------------------------------------------------------
-
- WORD TryLockFM()
- Trys to gain a lock on framemachine. If the machine is currently
- locked by someone else, this function returns ERR_LOCKED. Use
- WhoLocksFM() the get the name of the Task who as locked framemachine
-
- WORD UnLockFM()
- Releases lock on fm gained be LockFM() or TryLockFM(). Nesting allowed
-
- -----------------------------------------------------------------------------
-
- UBYTE* WhoLocksFM()
-
- Returns a pointer to a zero-terminated string containing the tasks name
- currently locking framemachine. NULL if nobodys locking it.
-
- -----------------------------------------------------------------------------
-
- BOOL PrismAttached()
- Returns TRUE if Prism-Board is attached, else FALSE
-
- -----------------------------------------------------------------------------
-
- LONG QueryFlags()
- flag-definitions see top of file
-
- -----------------------------------------------------------------------------
-
- WORD DigiState(BOOL on)
- activate/deactivate digitzer. when activating the digitizer, the currently
- display image will be destroyed.
-
- -----------------------------------------------------------------------------
-
- WORD SnapShot()
- the next reachable frame is stored in full resolution in YUV-RAM.
- DigiState is changed to FALSE. DisplaySize is changed to PDP_720.
-
- -----------------------------------------------------------------------------
-
- WORD ClearDisplay()
- Clears the display to black
-
- -----------------------------------------------------------------------------
-
- WORD SendI2C(UBYTE *table, UWORD size)
- Send several bytes on I2C-Bus (including Feature-Connector)
-
- table: Pointer to array of UBYTEs of a least size-bytes
- size: size of array
-
- Note: Using this function with the wrong values is critical.
-
-
-
-
-
-
-
-